const app = getApp()
Page({
  data: {
    resourceUrl3: app.globalData.apiUrl + '/public/uploads/goods/',
    statusType: ["全部拼团", "待成团中", "拼团成功", "拼团失败"],
    currentType: 0,
    tabClass: ["", "", "", "", ""]
  },
  statusTap: function (e) {
    var curType = e.currentTarget.dataset.index;
    this.data.currentType = curType
    console.log(curType)
    this.setData({
      currentType: curType
    });

    this.onShow();
  },
  onShow:function(){
    var that = this;
    var openid = app.globalData.openid;
    if (openid == null) {
      wx.switchTab({
        url: '/pages/my/my',
        success: function () {
          wx.showToast({
            title: '请登入后操作',
            icon: 'none',
            duration: 2000
          })
        }
      })
    }
    //全部
    wx.request({
      url: app.globalData.apiUrl+'/api/order/groupOrder',
      data: {openid:openid},
      method: 'GET',
      dataType: 'json',
      success: function(res) {
        console.log(res)
        that.setData({orderList:res.data})
      },
      fail: function(res) {},
      complete: function(res) {},
    })
  }
  

})